﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FrienDev.BusinessRules;
using FrienDev.Data;

public partial class Controls_SystemMessage_Activity_Invite : System.Web.UI.UserControl, ISystemMessageControl
{

    private string m_SenderId, m_SenderName, m_ActivityId, m_ActivityName;

    protected void Page_Load(object sender, EventArgs e)
    {
        this.img_UserImage.ImageUrl = ApiHelper.Instance.GetUserLogoUrl(m_SenderId);
        this.hl_SenderName.Text = m_SenderName;
        this.hl_SenderName.NavigateUrl = ApiHelper.Instance.GetUserHomepageLink(m_SenderId);
        this.hl_Sender.Text = m_SenderName;
        this.hl_Sender.NavigateUrl = ApiHelper.Instance.GetUserHomepageLink(m_SenderId);
        Activity activity=ActivityRules.Instance.GetActivityInfo(Convert.ToInt32(m_ActivityId));
        this.hl_Club.Text = activity.Club.ClubName+"俱乐部";
        this.hl_Club.NavigateUrl = "~/Club/detail.aspx?clubId=" + activity.ClubId;
        this.hl_ActivityName.Text = activity.ActivityName+"活动";
        this.hl_ActivityName.NavigateUrl = "~/Activity/detail.aspx?activityId=" + m_ActivityId;
        this.hl_Activity.Text = "http://www.clubof.net/Activity/detail.aspx?activityId=" + m_ActivityId;
        this.hl_Activity.NavigateUrl = "~/Activity/detail.aspx?activityId=" + m_ActivityId;
    }

    #region ISystemMessageControl Members

    public void Initialize(int messageId, string[] parameters)
    {
        m_SenderId = parameters[2];
        m_SenderName = parameters[3];
        m_ActivityId = parameters[4];
        m_ActivityName = parameters[5];
    }

    #endregion
}
